<%@ Page Language="C#" MasterPageFile="~/Administration/main.master" AutoEventWireup="true"
    CodeFile="Customers.aspx.cs" Inherits="Tathata.Web.Administration.Administration_Customers" %>

<asp:Content ID="c1" ContentPlaceHolderID="cph1" runat="Server">
    <h4>
        Customers</h4>
    <table class="adminContent">
        <tr>
            <td colspan="2">
                <asp:Button runat="server" Text="Export to XML" CssClass="adminButton" ID="btnExportXML"
                    OnClick="btnExportXML_Click" ValidationGroup="ExportXML"></asp:Button>
            </td>
        </tr>
    </table>
    <br />
    <br />
    <asp:GridView ID="gvCustomers" runat="server" AutoGenerateColumns="False" Width="100%"
        OnPageIndexChanging="gvCustomers_PageIndexChanging" AllowPaging="true" PageSize="15">
        <Columns>
            <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" Visible="False"></asp:BoundField>
            <asp:TemplateField HeaderText="Email" ItemStyle-Width="40%">
                <ItemTemplate>
                    <a href="customerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>">
                        <%#Server.HtmlEncode(Eval("Email").ToString())%>
                    </a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Name" ItemStyle-Width="40%">
                <ItemTemplate>
                    <a href="CustomerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>">
                        <%#Server.HtmlEncode(Eval("FullName").ToString())%>
                    </a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
                ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <a href="CustomerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>">Edit </a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="IsAdmin" HeaderText="Is admin" HeaderStyle-HorizontalAlign="Center"
                ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
        </Columns>
    </asp:GridView>
</asp:Content>
